import 'dart:async';
import 'package:qgchat/bloc/blocProvider.dart';
import 'package:qgchat/common/global/global.dart';
import 'package:qgchat/http/apis/user.dart';

class ManageAccountBloc implements BlocBase {

  // ##########  DEFAULT  ##############

  // ##########  STREAMS  ##############

  /// 填写邀请码stream
  StreamController _invite = StreamController.broadcast();
  Sink get _inviteSink => _invite.sink;
  Stream get inviteStream => _invite.stream;

  void dispose() {
    _invite.close();
  }

  // ##########  HANDLING  ##############

  /// 填写支付宝账号姓名
  void comfiralipay(id, memberToken, alipayUser, alipayName, callback) async {
    Map result = await UserApis.comfiralipay(id, memberToken, alipayUser, alipayName);
    if (result != null && result['status'] == 1) {
      showToast(result['msg']);
      callback();
    }
  }
}
